package toman;

import java.util.*;

/**
 * This is a helper class serving for holding a list of transfer objects. The TO objects are created in the constructor
 * from the list of raw data objects with the help of the TOMan instance.
 * <br>
 * User: zslajchrt
 * Date: 2.5.11
 * Time: 15:00
 */
public class TOList<T> extends ArrayList<T> {

    private static final long serialVersionUID = 976936832033285372L;

    public TOList(List<Object> resultList, Class<T> toClass, TOMan toman) {
        for (Object row : resultList) {
            T toInstance = toman.createTOInstance(toClass, row);
            add(toInstance);
        }
    }
}
